#include <stdio.h>

//初始化数组
void Init(int arr[],int n)
{
    int i = 0;
    for (i = 0; i < n; i++)
    {
        arr[i] = 0;
    }
}

//打印数组
void print(int arr[],int n)
{
    int i = 0;
    for(i = 0; i < n; i++)
    {
        printf("%d ",arr[i]);
    }
    printf("\n");
}

//数组逆置
void reverse(int arr[],int n)
{
    int left = 0;
    int right = n-1;
    int temp = 0;
    while(left < right)
    {
        temp = arr[left];
        arr[left] = arr[right];
        arr[right] = temp;
        left++;
        right--;
    }
}

int main()
{
    int arr[10];
    int sz = sizeof(arr) / sizeof(arr[0]); 
    Init(arr,sz);
    print(arr,sz);
    int ar[5] = {1,2,3,4,5};
    int sg = sizeof(ar) / sizeof(ar[0]);
    reverse(ar,sg);
    print(ar,sg);
    return 0;
}